# Topic 11e # Look at the Student's-t distribution # # First we will look at the standard # Student's-t, mean=0, standard deviation=1 # # We will just repeat the kind of questions that # we saw in earlier distributions. # # Remember, that for the Student's-t we need to # know the number of degrees of freedom to use # ############################################ # Using the table, find #For the standard Student's-t distribution # for df=6 P(X < -0.47 ) = # for df=18 P(X < -0.47 ) = # for df=60 P(X < -0.47 ) = # for df=32 P(X <= 2.38 ) = # for df=19 P(X < 1.3765) = # for df=5 P( X > 2.24 ) = # for df=15 P( X > -1.39 ) = # for df=28 P( -0.62 < X < 1.26 ) = # for df=14 P( X < 0.34 or X>0.98 ) = ###################################### ################ # Now go back and try to do those problems # with the "Critical Values for the Student's-t" # table. ################ ###################################### # now do the same using the pt() function # for df=6 P(X < -0.47 ) = pt( -0.47, 6 ) # for df=18 P(X < -0.47 ) = pt( -0.47, 18 ) # for df=60 P(X < -0.47 ) = pt( -0.47, 60 ) # for df=32 P(X <= 2.38 ) = pt( 2.38, 32 ) # for df=19 P(X < 1.3765) = pt( 1.3765, 19 ) # for df=5 P( X > 2.24 ) = 1 - pt( 2.24, 5 ) # Is one approach pt( 2.24, 5, lower.tail=FALSE ) # another way # for df=15 P( X > -1.39 ) = 1 - pt( -1.39, 15 ) # Is one approach pt( -1.39, 15, lower.tail=FALSE ) # another way # for df=28 P( -0.62 < X < 1.26 ) = pt(1.26, 28) - pt(-0.62, 28) # for df=14 P( X < 0.34 or X>0.98 ) = pt(0.34,14) + (1-pt(0.98, 14)) # is one way pt(0.34, 14) + pt( 0.98, 14, lower.tail=FALSE)# is another way ####################################### ## go back to the table and use it to solve: # # find the y value such that # for df=8 P(X < y ) = 0.2374 y= # for df=5 P(X < y ) = 0.7620 y= # for df=13 P(X > y ) = 0.3550 y= # for df=22 P(X > y ) = 0.9181 y= # for df=9 P(X < y ) = 0.6409 y= # because Student's-t is symmetric # for df=12 P(X< -y or X>y ) = 0.0348 y=? ###################################### ###################################### # now do the same using the qt() function # for df=8 P(X < y ) = 0.2374 y= qt( 0.2374, 8 ) # for df=5 P(X < y ) = 0.7620 y= qt( 0.7620, 5 ) # for df=13 P(X > y ) = 0.3550 y= qt( 1 - 0.3550, 13 ) # is one way qt( 0.3550, 13,lower.tail=FALSE ) # is another way # for df=22 P(X > y ) = 0.9181 y= qt( 1 - 0.9181, 22 ) # is one way qt( 0.9181, 22, lower.tail=FALSE ) # is another way # for df=9 P(X < y ) = 0.6409 y= qt( 0.6409, 9 ) # because Student's-t is symmetric # for df=12 P(X< -y or X>y ) = 0.0348 y=? qt( 0.0348/2, 12, lower.tail=FALSE) ############################################# ## Now we will look at non-standard Student's-t ## distribution. For each such non-standard ## Student's-t distribution we need to give the ## mean and the standard deviation of that ## distribution. We will do this in the ## St(mean, standard deviation) syntax. Thus ## St(25,7) is a Student's-t distribution with ## mean=25 and standard deviation=7. ############################################### ## # for a St(25,7) with 18 df find P(X < 32) # the long way is to compute the equivalent t value # for a standard Student's-t with 18 df t <- (32 - 25)/7 t # and then find P(X < t ) for df=18 and St(0,1) pt( t, 18 ) # for a St(9,13) with 7 df, find P(X<32) # the long way t <- (32-9)/13 t pt( t, 7 ) # for St(13.7, 4.6) and df=26 find P( X > 16.2 ) # the long way t <- (16.2 - 13.7)/4.6 t pt( t, 26, lower.tail=FALSE) # or 1 - pt( t, 26) # for St(-6.2, 1.34) with df=4 find P( -7 < x < -5) # the long way t1 <- (-7 - -6.2)/1.34 t1 t2 <- (-5 - -6.2)/1.34 t2 pt( t2, 4 ) - pt(t1,4) ############################################## ### Now we will go the other way. Find the ### y value such that p is the desired ### probability. # for a St(45.7,8.6 ) with df=16, find y such # that P(X < y ) = 0.333 # the long way... # what is the t value in a standard Student's-t # with df=16 such that P(X < t) = 0.333 t <- qt( 0.333, 16 ) t # then translate that back to our St(45.7, 8.6) t*8.6+45.7 # for a St(-9.2, 1.6 ) with df=34, find y such # that P(X > y ) = 0.219 # what is the t value in a standard Student's-t # such that P(X > t) = 0.219 t <- qt( 1 - 0.219, 34 ) t # then translate that back to our St(-9.2, 1.6 ) t*1.6 + -9.2 # for a St(134.2, 12.43 ) with df=7 distribution, # find y1 and y2 such # that P(X < y1 or X>y2 ) = 0.075 # and where abs(mean - y1 ) = abs(mean-y2) # What is the t value in a standard Student's-t # such that P(-z < X < z) = 0.075 # # this works because the Student's-t distribution # is symmetric t <- qt( 0.075/2, 7, lower.tail=FALSE ) t # then translate t back to our N(134.2, 12.43 ) y2 <- t*12.43 + 134.2 # this is our y2 y2 # and translate -z back to our N(134.2, 12.43 ) y1 <- -t*12.43 + 134.2 # this is our y1 y1 # note abs(134.2-y1) abs(134.2-y2)